<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>旋转动画</title>
    <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.min.css">
    <script src="../libs/jquery3_1_1.min.js"></script>
    <style>
        .box{
            width: 100px;
            height: 100px;
            margin:20px auto;
            background-color: #ff705e;
        }

        .rorate{
            animation-duration: 1s;
            animation-name: rorate;
            animation-iteration-count: infinite;
        }

        @keyframes rorate {
            100%{
                transform: rotate(360deg);
            }
        }
    </style>
</head>
<body>
<div class="container">
    <div class="box"></div>

    <button class="btn btn-primary">点击旋转</button>
</div>
</body>
</html>
<script>
    $(function () {
        $('button').on('click',function () {
            $(".box").toggleClass("rorate");
        });
    })
</script>